package org.alex.samples.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.alex.samples.model.ExamTestVO;

public class TestUtils {

	public static boolean checkSubjectScoreAndCount(Integer totalTestScore, Integer totalTestCount,
			Map<Integer, Integer> testTypeScoreMap) {

		return false;
	}

	public static Map<Integer, Integer> getTestCountByScore(Integer totalTestCount,
			Map<Integer, Integer> testTypeScoreMap) {
		// TODO Auto-generated method stub
		return null;
	}

	public static List<Integer> getRandomTestIdList(List<ExamTestVO> testList, Integer count) {
		List<Integer> randList = new ArrayList<Integer>();
		int i=0;
		while (i<count) {
			boolean j = true;
			Integer rand = (int) (Math.random() * testList.size());
			Integer id=testList.get(rand).getId();
			for (Integer tid : randList) {
				if (id == tid) {
					j = false;
				}
			}
			if (j) {
				i++;
				randList.add(id);
			}
		}
		return randList;
	}

}
